<%-- 
    Document   : index9
    Created on : 2015-9-24, 15:03:45
    Author     : Fire
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script src="plugins/react/react.js" type="text/javascript"></script>
        <script src="plugins/react/browser.min.js" type="text/javascript"></script>
    </head>
    <body>
        <script type="text/babel">
            var Input = React.createClass({
                getInitialState:function(){
                    return {value:'hello'}
                },
                handleChange:function(event){
                    this.setState({value:event.target.value});
                },
                render:function(){
                   var value = this.state.value;
                   return (
                    <div>
                      <input type="text" value={value}
                      onChange={this.handleChange}/>
                              <p>{value}</p>
                    </div>       
                    );
                }
            });
            React.render(
                    <Input />,
                  document.body
            );
        </script>
    </body>
</html>
